On diamond-free subposets of the Boolean lattice: An application of flag algebras