Fix Resource handling issues
Fix Resource handling issues

Close file descriptors before return

Resolves: LE-7912
Change-Id: I76e7ebdd4901c194942872d7b6e5ede055af3aa2

legatoproject/legato-af,legatoproject/legato-af,legatoproject/legato-af,legatoproject/legato-af,legatoproject/legato-af,legatoproject/legato-af,legatoproject/legato-af,legatoproject/legato-af,legatoproject/legato-af