Frameworks: fix possible NPE (PIE)

due a race condition this can happen....prevend it

cheers

Change-Id: I65222389c6b0beecaebed915644ab5e800c5f119