Fix projection for dolfin-adjoint

Introduce a variable holding the solve function to be used by
project. This enables dolfin-adjoint to overload the solve call.