callScript: export child resourse via global var

The proc_open resulting resource may be needed outside the callScript()
function if a user has signal handlers. E.g., a user may want to limit
the execution time of a gateway scipt using the pcntl_alarm(). In that
case the child process may need to be terminated explicitly using the
$script_child_res global resource.
API to retrieve the newly created entity ID

When you implement a plugin that need to process the newly created
entity (by chaining after the original ophandler), you need to know the
entity id. lastInsertID() is not a choise since there may be multiple
inserts to different tables in the original ophandler.

lastCreated: new function to track or return the last created IDs
getLastCreatedId: wrapper around lastCreated(), filtering the last
created ID of a given realm.

these functions changed to call lastCreated():
	commitAddObject
	commitAddPort
	commitCreateUserAccount
	createIPv4Prefix
	createIPv6Prefix
	addVService
	addVSG
	createVLANDomain
	addRStoRSPool
	commitCreateRSPool
	tableHandler