forkfile: only open O_RDWR if necessary
forkfile: only open O_RDWR if necessary

Closes #4552.

Signed-off-by: Christian Brauner <2314b2e3a4a1f7db165be2aafbf1efd78f28cc97@brauner.io>

Skarlso/lxd,lxc/lxd,atxwebs/lxd,stgraber/lxd,lxc/lxd,mjeanson/lxd,lxc/lxd,hallyn/lxd,mjeanson/lxd,lxc/lxd,erikmack/lxd,lxc/lxd,stgraber/lxd,atxwebs/lxd,hallyn/lxd,stgraber/lxd,hallyn/lxd,lxc/lxd,Skarlso/lxd,hallyn/lxd,atxwebs/lxd,hallyn/lxd,stgraber/lxd,mjeanson/lxd,stgraber/lxd,lxc/lxd,Skarlso/lxd,erikmack/lxd,Skarlso/lxd,erikmack/lxd,stgraber/lxd,stgraber/lxd,hallyn/lxd,atxwebs/lxd