php: do_install cleanup tests dir exists before trying rmdir $TMP

Build fails at the end of do_install because TMPDIR is inherited from bitbake's TMPDIR (which is an absolute PATH)
The concatenation of D and TMDIR leads to a non existing directory, that we fail to remove.
Testing directory existence on $TMP before issuing rmdir $TMP is a safeguard mesure that will make sure rmdir is only run on actually existing directories.