Since I need to move that file to the host computer using adb pull command, I get root access to change the owner of that file to shell (surprisingly I find the files are located in /data/media/0, not directly in /data/media):

The data under the /storage/emulated/legacy is accessed through a particular, restrictive method called Emulated SD Card File System, which acts like a mask, and prevents you or any app from editing ownership or permissions of the files accessed from within it, thus adding a layer of security (and you can see it in the mount output /data/media /storage/emulated/legacy esdfs [...]). If you or an app have root permissions, though, you can directly access the unmasked, underlying filesystem and make potentially dangerous changes, as proven by the successful permission editing...
– Death Mask SalesmanDec 2 '16 at 16:48

... you yourself did, by issuing chmod 755 contacts2.db. The data under /data/media belongs to root because it's not meant to be accessed that way.
– Death Mask SalesmanDec 2 '16 at 16:49