Update adapter.php

Modified insertIfNotExist() to support NULL values

supersedes https://github.com/owncloud/core/pull/4560, also changed code to better fit our guidelines

@bartv2 @DeepDiver1975