First- and second-order phase transitions, Fulde-ferrel inhomogeneous state, and quantum criticality in ferromagnet/superconductor double tunnel junctions