ConstantBuffer: Fallback to device parameter if GraphicsDevice is null

Looks like this code references the GraphicsDevice property on itself even though the device is passed in as an argument.  In some situations the GraphicsDevice property can be null, which causes a crash.  This allows the code to fall back to the parameter if that's the case (and everything works correctly as the device that's passed in is guaranteed to be the one being locked by the caller).