Commutative monoids all of whose principal ideals are projective