Installer: Check if /extensions is readable and a directory

Also close the dirhandler and fix one return value

bug: 46447
Change-Id: I0abe540d66375e6833640bb234e62b6cc902beb0
Merge "Installer: Check if /extensions is readable and a directory"