Formation of current layers in three‐dimensional, inhomogeneous coronal magnetic fields by photospheric motions