Implement missing stream metadata for chmod, chown and chgrp, lchown and lchgrp

PHP added stream metadata in PHP 5.4 for chmod, chown, chgrp, lchmod and lchgrp.
http://php.net/manual/en/streamwrapper.stream-metadata.php

Closes #3687. Closes #4027.