Install periodic scripts with executable  bit
Speed up a bit port version by caching directory subdir
Preserve automatic flag on forced reinstall.

Issue:	#884
Do not ignore the last entry from SUBDIR
Speed up a bit more pkg version by not spawning useless sh
Fix memory corruption when using pkg files.
Fix universe free for reinstalled packages.

Get rid of double free of struct pkg* for packages reinstalled.
Fix usage of posix_spawn

Reported by:	jilles